package vis.core.service.sys;


import vis.core.common.security.AuthUser;
import vis.core.domain.db.SysUser;
import vis.core.domain.search.Psh;
import vis.core.domain.sys.UserTokenVo;
import com.mybatisflex.core.paginate.Page;

/**
 * 用户服务
 */
public interface SysUserService {

    /**
     * 新增用户
     */
    boolean insert(SysUser param);

    boolean delete(String ids);

    /**
     * 修改
     */
    boolean update(SysUser param);

    /**
     * 给用户分配角色
     */
    void insertUserRole(String userId, String roleIds);

    /**
     * 注册用户
     *
     * @param type 电话1；邮件2
     */
    boolean sysUserRegister(String type, String phone, String email, String password, String password2, String captcha);

    boolean resetUserPassword(String userIds, String newPassword);

    UserTokenVo refreshToken(String refreshToken);

    SysUser appUserInfo();

    SysUser systemUserInfo();

    boolean resetMyPassword(String oldPassword, String newPassword);

    /**
     * 查询用户信息，生成Token携带的额外信息
     *
     * @param userId 用户ID
     * @return Token中需要携带的信息
     */
    AuthUser createUserTokenExtra(String userId);

    SysUser updateUserInfo(SysUser param);

    boolean isBindCard();

    boolean bindCard(String idCardName, String idCardNumber);

    boolean accountIsRoot(String account);

    Page<SysUser> page(SysUser sysUser, Psh psh);
}
